<template>
    <block v-if="!item.children">
        <el-menu-item :index="item.path" v-if="!item.noShow">
            <el-icon>
                <component :is="item.icon"></component>
            </el-icon>
            <template #title>{{ item.meta.text }}</template>
        </el-menu-item>
    </block>

    <block v-else>
        <el-sub-menu :index="item.path">
            <template #title>
                <el-icon>
                    <component :is="item.icon"></component>
                </el-icon>
                <span>{{ item.meta.text }}</span>
            </template>
            <Menu v-for="(l, i) in item.children" :key="i" :item="l"></Menu>
        </el-sub-menu>
    </block>
</template>

<script setup lang="ts">
const props: any = defineProps({
    item: Object
})
</script>